# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=python-stopit
_pyname=stopit
pkgver=1.1.2
pkgrel=6
pkgdesc='Library to raise asynchronous exceptions in other thread, control the timeout of blocks or callables'
url='https://github.com/glenfant/stopit'
arch=('any')
license=('GPL3')
makedepends=('python' 'python-setuptools')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/glenfant/${_pyname}/archive/${pkgver}.tar.gz)
sha512sums=('4b1771a357f35a82128e92d7e91fa3e788271a3d6f1e08bacee69546c7c2fa857104394d8617259235c413b7f1706ccd4ff9ed480af5e1faef1149d1c1e0a0e0')

prepare() {
  cp -ra ${_pyname}-${pkgver}{,-py2}
}

build() {
  (cd ${_pyname}-${pkgver}
    python setup.py build
  )
}

check() {
  (cd ${_pyname}-${pkgver}
    python setup.py test
  )
}

package() {
  depends=('python')
  cd ${_pyname}-${pkgver}
  python setup.py install -O1 --root="${pkgdir}" --prefix=/usr --skip-build
  install -Dm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
